package com.hyt.it.ogt.ks.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSON;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hyt.core.base.BaseServiceImpl;
import com.hyt.it.ogt.ks.mapper.CjLogMapper;
import com.hyt.it.ogt.ks.model.cjvo.CjLogQueryParam;
import com.hyt.it.ogt.ks.model.entity.CjLog;
import com.hyt.it.ogt.ks.service.ICjLogService;

import lombok.extern.slf4j.Slf4j;

/**
 * 考试推送成绩接口
 */
@Service
@Slf4j
public class CjLogServiceImpl extends BaseServiceImpl<CjLogMapper, CjLog> implements ICjLogService {
	
	@Autowired
	private CjLogMapper cjLogMapper;
	
	@Override
	public List<CjLog> selectCjLogList(CjLogQueryParam apiLog, int pageNo, int pageSize) {
		log.debug("selectCjLogList params:{}", JSON.toJSON(apiLog));
		PageInfo<CjLog> pageInfo = PageHelper.startPage(pageNo, pageSize).doSelectPageInfo(() -> {
			CjLogQueryParam logParem = new CjLogQueryParam();
			logParem.setExamId(apiLog.getExamId());
			logParem.setCandidateId(apiLog.getCandidateId());
			logParem.setPushCjStatus(apiLog.getPushCjStatus());
			logParem.setQueryStartTime(apiLog.getQueryStartTime());
			logParem.setQueryEndTime(apiLog.getQueryEndTime());
			cjLogMapper.selectCjLogList(logParem);
		});
		return pageInfo.getList();
	}

}
